import Mock from 'mockjs';
import { baseUrl } from "./index";
// 下载接口
Mock.mock(`${baseUrl}/download`, 'post', (option) => {
  let request = JSON.parse(option.body);
  if (request.type === 'blob') {
    // 模拟blob流下载
    let data = new Blob()
    return {
      success: true,
      msg: '登录成功',
      data: {
        token: Mock.mock('@word(15)')
      }
    }
  } else {
    return {
      success: false,
      code: 'login_fail_1',
      msg: '登录失败，账号为admin，密码admin@123',
      data: {}
    }
  }
});
